<?php
	include_once('../../php/postgre.php');
	$ids=$_GET['ids'];

	if(is_numeric($ids)) {
	$koja = get_data("select * from mus_urusan where id_urusan='$ids'");
	$kojap = $koja['kode_urusan'];
	
	/*$dot = array();
	$id = get_data("select count(id_klasifikasi) as mac from mus_klasifikasi where id_urusan='$ids'");
	
	$kode_kla = $kojap.".".($id['mac'] + 1);
	echo $kode_kla;*/
	
	if( $kojap=='xx'){
		$kode_kla = $kojap.".xx" ;
		echo $kode_kla;
	}
	else {
		$dot = array();
		$id = get_data("select count(id_klasifikasi) as mac from mus_klasifikasi where id_urusan='$ids'");
		$val = $id['mac'] + 1;
		$kode = ($val<=9)? "0".$val:$val;
		$kode_kla = $kojap.".".$kode;
		echo $kode_kla;
	}
	
	}
	
	
	
?>